//
//  GZFilterHtml.m
//  lv678
//
//  Created by apple on 15/7/17.
//  Copyright (c) 2015年 lampshade. All rights reserved.
//

#import "GZFilterHtml.h"
#import "TFHpple.h"

@implementation GZFilterHtml
//过滤掉HTML中的标签
- (NSString *)filterHTML:(NSString *)html{
    NSScanner *scanner = [NSScanner scannerWithString:html];
    NSString *text = nil;
    while ([scanner isAtEnd]==NO) {
        [scanner scanUpToString:@"<" intoString:nil];
        [scanner scanUpToString:@">" intoString:&text];
        html = [html stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"%@>",text] withString:@""];
    }
    return html;
}

- (void)parseSearchResult:(NSData *)result{
    TFHpple *doc = [TFHpple hppleWithHTMLData:result];
    NSArray *array = [doc searchWithXPathQuery:@"//p"];
    NSString *this = nil;
    for (TFHppleElement *hpple in array) {
        this = hpple.raw;
    }
}
@end
